<%--
  Created by IntelliJ IDEA.
  User: 11875
  Date: 2021/10/18
  Time: 10:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>宿舍管理系统</title>
    <link rel="stylesheet" href="/css/homepageheder.css">
    <link rel="stylesheet" href="/css/tradmilsit.css">
    <link rel="stylesheet" href="/css/addinfo.css">
    <link rel="stylesheet" href="/css/bootstrap.css">
</head>

<body>
<!-- 头部 -->
<div class="heder">
    <div class="title">
        <div class="title_t">
            <span>宿 舍 管 理 系 统</span>
        </div>
        <div class="title_r">
            欢迎您！！！
            <c:if test="${user.typeid == 1}">
                班主任老师
            </c:if>
            <c:if test="${user.typeid == 2}">
                班主任老师
            </c:if>
            ${user.uname}
            <span>|</span>
            <a href="javascript:history.go(-1)">返回上一页</a>
            <span>|</span>
            <a href="/user/main">返回主页</a>
            <span>|</span>
            <a href="/logout">退出</a>
        </div>
    </div>
</div>

<div class="hr"></div>

<div id="content">
    <div class="container clearfix">
        <h3>修 改 密 码</h3>
        <form method="post" action="/user/updatepassword" onsubmit="return chkform(this)">
            <div class="classinput">
                <div class="phone">
                    <span>当前密码</span>
                    <input type="password" name="cpassword">
                    <div class="text-danger">
                        <c:if test="${err!=null}">
                            ${err}
                        </c:if>
                    </div>
                </div>
                <div class="birthday">
                    <span>新密码</span>
                    <input type="password" name="npassword">
                    <div class="text-danger"></div>
                </div>
                <div class="clearfix">
                    <button type="submit" class="btn btn-primary">修 改</button>
                </div>
            </div>
        </form>
    </div>
</div>


<script src="/js/jquery-3.6.0.min.js"></script>
<script src="/js/bootstrap.js"></script>
<script>
    function chkform(argform) {
        if ((argform.cpassword.value) == "") {
            $(argform.cpassword).next("div").html("当前密码不能为空...");
            return false;
        }
        if ((argform.npassword.value) == "") {
            $(argform.npassword).next("div").html("新密码不能为空...");
            return false;
        }
        return true;
    }
</script>
</body>

</html>